// index.js
Page({
  data(){

  },
  onLoad: function(options){
    this.getBanner()
  },
  getBanner(){
    wx.cloud.database().collection('banners').get().then(
      res=>{
        this.setData({
          bannerList: res.data
        })
      }
    )
  },
  toBannerDetail(event){
    let id = event.currentTarget.dataset.id
    wx.navigateTo({
      url: '/pages/index/bannerDetail/bannerDetail?bannerId=' + id,
    })
  }
})
